<?php
global $VALUTA, $MONTHS2;
?>

<h1>Редактирование фиксации суммы на счёте</h1>
<form method=post action='schet/fix_edit_save' enctype='multipart/form-data'>
	<input type='hidden' name='id' value='<?=$fix['id']?>'>
	<input type='hidden' name='last_url' value='<?=$last_url?>'>
	<table class='edit' cellspacing=0>
		<tr>
			<td>Счёт</td>
			<td><select name='schet_id'>
			<?php foreach($scheta as $s) { ?>
				<option value='<?=$s['id']?>' <?php if($s['id'] == $fix['schet_id']) echo "selected"; ?>><?=$s['name']?> <?=$VALUTA[$s['valuta']]?></option>
			<?php } ?>
			</select></td>
		</tr>
		<tr>
			<td>Дата / время</td>
			<td>
			<?php
			$time = strtotime($fix['date']);
			?>
				<select name='day'>
					<?php for($i = 1; $i<=31; $i++) {?>
						<option value='<?=$i?>' <?php if($i == date("j", $time)) echo "selected"; ?>><?=$i?></option>
					<?php } ?>
				</select> . <select name='month'>
					<?php foreach($MONTHS2 as $k => $v) {?>
						<option value='<?=$k?>' <?php if($k == date("n", $time)) echo "selected"; ?>><?=$v?></option>
					<?php } ?>
				</select> . <select name='year'>
					<?php for($i = 2011; $i<=(date("Y") + 1); $i++) {?>
						<option value='<?=$i?>' <?php if($i == date("Y", $time)) echo "selected"; ?>><?=$i?></option>
					<?php } ?>
				</select>
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<select name='hour'>
					<?php for($i = 0; $i <= 23; $i++) {?>
						<option value='<?=$i?>' <?php if($i == date("H", $time)) echo "selected"; ?>><?=sprintf("%02d", $i)?></option>
					<?php } ?>
				</select> : <select name='minute'>
					<?php for($i = 0; $i <= 59; $i++) {?>
						<option value='<?=$i?>' <?php if($i == date("i", $time)) echo "selected"; ?>><?=sprintf("%02d", $i)?></option>
					<?php } ?>
				</select>
			</td>
		</tr>
			<tr>
				<td>Сумма</td>
				<td><input type='text' name='summ' value='<?=number_format($fix['summ'], 2, $setting['znak_drob'], '')?>' readonly class='noborder'></td>
			</tr>
			<tr>
				<td>Комментарий</td>
				<td><textarea name='comment' style="width:93%; height:70px;"><?=htmlspecialchars($fix['comment'])?></textarea></td>
			</tr>
			<tr>
				<td>Подтверждение</td>
				<td><?php if($fix['file']) { ?><a href='<?=UPLOAD_PATH.$fix['file']?>' target=_blank>Посмотреть</a><br><br><?php } ?><input type='file' name='file'></td>
			</tr>
		</table>
		<br>
		<input type='submit' name='save' value='Сохранить'>

	</form>


